<!DOCTYPE html>
<#assign secSelect = JspTaglibs["http://www.casic304.cn/secSelect"] />
<#assign dicSelect = JspTaglibs["http://www.casic304.cn/dicSelect"]/>
<#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
<html>
<head>
  <meta charset="utf-8">
  <title>化学物理电源基本信息</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
  <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
  <script type="text/javascript">
    var __ctx = "${ctx}";

  </script>
  <style>
    .qbdms-TBinformation{margin-left: 0;font-size: 15px}
  </style>
</head>

<body class="listBody">

<div class="qbdms-bodyDiv">
  <div class="qbdms-backDiv">
    <div class="layui-table-view-body" style="padding: 0 24px 24px;">
      <div class="qbdms-formTitle" style="border-bottom: 1px solid #E5F0FF">化学物理电源信息 <i
          class="qbdms-returnOn closeWindow">返回</i></div>
      <form class="layui-form treeFormPreview"
            requrl="${ctx}/qbdms/wQbdChemicalPhysicsInfo/get"
            lay-filter="wQbdChemicalPhysicsInfoDataForm" style="bottom: 30px">
        <@fillDept.dept css="dragInfo temSpace" id="tbxx"/>
        <div class="layui-row">
          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="检测日期">检测日期<span
                style="color: red;">*</span></label>
            <div class="layui-input-block qbdms-input">
              <input type="text" placeholder="请输入" autocomplete="off"
                     class="layui-input dateTimeFiled" lay-verify="required" name="monitoringTime"
                     lay-reqtext="检测日期是必填项" readonly>
            </div>
          </div>

          <div style="width: 45%">
            <label class="layui-form-label qbdms-label" title="密级">密级<span
                style="color: red;">*</span></label>
            <div class="layui-input-block qbdms-input">
              <@secSelect.sec_select data_src=1 required=true name="secret"/>
            </div>
          </div>


          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="种类">种类<span
                style="color: red;">*</span></label>
            <div class="layui-input-block qbdms-input">
              <select id="type" name="type" autocomplete="off" class="layui-input"
                      maxlength="50" fieldname="type" disabled lay-verify="required">
              </select>
            </div>
          </div>


          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="所属产品类别">所属产品类别<span
                style="color: red;">*</span></label>
            <div class="layui-input-block qbdms-input">
              <select id="productCategory" name="productCategory" autocomplete="off"
                      class="layui-input" lay-filter="productCategory"
                      fieldname="productCategory" lay-verify="required"
                      lay-reqtext="所属产品类别是必填项">
              </select>
            </div>
          </div>


          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="产品名称">产品名称<span
                style="color: red;">*</span></label>
            <div class="layui-input-block qbdms-input">
              <select id="productName" name="productName" autocomplete="off"
                      class="layui-input"
                      maxlength="50" fieldname="productName" lay-verify="required"
                      lay-reqtext="产品名称是必填项">
              </select>
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="交付数量">交付数量</label>
            <div class="layui-input-block qbdms-input">
              <input type="text" name="deliveryQuantity" placeholder="请输入"
                     autocomplete="off" class="layui-input textInput"
                     maxlength="50" fieldname="deliveryQuantity" lay-verify="num"
                     id="deliveryQuantity">
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="本批是否合格">本批是否合格</label>
            <div class="layui-input-block qbdms-input">
              <@dicSelect.dic name="isQualified" css="layui-input filter-value" nodeKey="sfhg" />
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="批次号">批次号</label>
            <div class="layui-input-block qbdms-input">
              <input type="text" name="batchNumber" placeholder="请输入"
                     autocomplete="off" class="layui-input textInput"
                     maxlength="50" fieldname="batchNumber">
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="产品代号">产品代号</label>
            <div class="layui-input-block qbdms-input">
              <input type="text" name="productCode" placeholder="请输入"
                     autocomplete="off" class="layui-input textInput"
                     maxlength="50" fieldname="productCode">
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="所处阶段">所处阶段</label>
            <div class="layui-input-block qbdms-input">
              <@dicSelect.dic name="atTheStage" css="layui-input filter-value" search=true
              nodeKey="scjd" />
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="问题原因">问题原因</label>
            <div class="layui-input-block qbdms-input">
              <@dicSelect.dic name="problemCauses" css="layui-input filter-value" nodeKey="wtyy" />
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label"
                   title="出问题产品数量（只/组/台/套）">出问题产品数量（只/组/台/套）</label>
            <div class="layui-input-block qbdms-input">
              <input type="text" name="defectiveProductsNumber" placeholder="请输入"
                     autocomplete="off" class="layui-input textInput"
                     maxlength="50" fieldname="defectiveProductsNumber" lay-verify="numberDef">
            </div>
          </div>
          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="外协单位">外协单位</label>
            <div class="layui-input-block qbdms-input">
              <input type="text" name="outsourcingUnit" placeholder="请输入"
                     autocomplete="off" class="layui-input textInput"
                     maxlength="50" fieldname="outsourcingUnit">
            </div>
          </div>

          <div style="width: 65%">
            <label class="layui-form-label qbdms-label" title="不满足技术指标">不满足技术指标</label>
            <div class="layui-input-block qbdms-input">
              <@dicSelect.dic name="notMeetSpecifications" css="layui-input filter-value"
              search=true nodeKey="bmzjszb" />
            </div>
          </div>

        </div>


        <div class="layui-hide">
          <input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input "
                 maxlength="50" fieldname="id">
          <input type="text" name="fillman" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="fillman">
          <input type="text" name="fillmanaccount" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="fillmanaccount">
          <input type="text" name="filldept" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="filldept">
          <input type="text" name="filldeptid" placeholder="请输入填写部门id"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="filldeptid">
          <input type="text" name="filldepthospital" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50"
                 fieldname="filldepthospital">
          <input type="text" name="filldepthospitalid" placeholder="请输入二级部门id"
                 autocomplete="off" class="layui-input " maxlength="50"
                 fieldname="filldepthospitalid">
          <input type="text" name="filldate" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="filldate">
          <input type="text" name="fMainunitid" placeholder="请输入主承担单位ID"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="fMainunitid">
          <input type="text" name="createBy" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="createBy">
          <input type="text" name="tenantId" placeholder="请输入租户Id"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="tenantId">
          <input type="text" name="reportStatusTemp" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50"
                 fieldname="reportStatusTemp">
          <input type="text" name="reportStatus" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="reportStatus">
          <input type="text" name="reportDate" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="reportDate">
          <input type="text" name="reportReason" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="reportReason">
          <input type="text" name="returnmsg" placeholder="请输入"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="returnmsg">
          <input type="text" name="fTechnology" placeholder="组织负责人code"
                 autocomplete="off" class="layui-input " maxlength="50" fieldname="returnmsg">
        </div>

        <div class="layui-form-item" style="margin-top: 48px">
          <p style="text-align: left;margin-left: 145px;">
                    <span id="hideAndShow" style="">
                        <a lay-submit lay-filter="wQbdChemicalPhysicsInfo" class="layui-btn btn-n privateSubmit qbdms-oneBtn"
                           requrl="${ctx}/qbdms/wQbdChemicalPhysicsInfo/save">提交</a>
                    </span>
            <button type="reset" id="closeWindow" style="margin-left: 10px;"
                    class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">取消
            </button>
          </p>
        </div>

      </form>
    </div>
  </div>
</div>


<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>

  layui.config({
    base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
  }).extend({
    index: 'lib/index'  //主入口模块
  }).use(['index', 'common', 'laydate', 'jquery', 'qbdmsForm','publicMethods','propsHandle'],
      function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var form = layui.qbdmsForm;
        var common = layui.common;
        var publicMethods = layui.publicMethods;
        var typeList = eval('${typeList}'); //种类
        common.initDicData("type", typeList)
        var productCategoryList = eval('${productCategoryList}'); //所属产品类别
        common.initDicData("productCategory", productCategoryList)
        var productNameList = eval('${productNameList}'); //产品名称
        if (null != productNameList && "" != productNameList) {
          common.initDicData("productName", productNameList)
        }
        var propsHandle = layui.propsHandle;
        var defProps = {
                  //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
                  viewMould: 'moulds/', // 组件模块 存放文件 *****
                  selectorBtn: '.selectorBtn'
                },
                temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
          selectorBtn: defProps.selectorBtn,
          selectorTemPath: setter.views + defProps.viewMould
        });

        var type = "${type}";
        if (null != type && "" != type) {
          $('#type').val(type);
        }
        form.on('select(productCategory)', function (data) {
          $.ajax({
            url: "${ctx}/qbdms/wQbdChemicalPhysicsInfo/getSelectData",
            type: "post",
            data: {
              "typeValue": type,
              "productCategoryValue": data.value,
            },
            dataType: 'json',
            success: function (data) {

              $("#productName").empty();
              common.initDicData("productName", data)
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
              layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
              //执行重载
              reflashQuery(true);
              dateReflash();
            }
          })
    });
    var dateTimeFiledLen = $(".dateTimeFiled");
    for (var i = 0; i < dateTimeFiledLen.length; i++) {
      laydate.render({
        elem: dateTimeFiledLen[i] //指定元素
        , type: 'date'
        , trigger: 'click'
        ,max:new Date().valueOf()
      });
    }


        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
          window.location.href = '${ctx}/qbdms/wQbdChemicalPhysicsInfo/view/list';
        });

    var runId = "${runId}";
    if (runId == null || runId == '') {
      $("#hideAndShow").show();
    }
        form.verify({
          num: function (value) {
            // 如果值为空，不触发校验
            if (value && !new RegExp(/^[1-9]\d*$/).test(value)) return "交付数量只能输入非负整数";

          },
          numberDef: function (value) {
            // 如果值为空，不触发校验
            if (value && !new RegExp(/^[1-9]\d*$/).test(value)) return "出问题产品数量（只/组/台/套）只能输入非负整数";

          }
        });
    var index = parent.layer.getFrameIndex(window.name);
    common.updateForm({
      name: 'wQbdChemicalPhysicsInfoDataForm',
      idValue: "${id}",
      primary: "id",
      updateCallback: function (data) {
        if (common.filterRecord(data)) {
          if ($(".privateSubmit")) {
            $(".privateSubmit").attr("disabled", false).css("pointer-events", "auto");
          }
          layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'}, function (index) {
            layer.close(index);
            window.location.href = '${ctx}/qbdms/wQbdChemicalPhysicsInfo/view/list';
          });
        } else {
          layer.alert(publicMethods.confirmStyle(data.msg),{title: false,skin: 'confirm-class'});
        }
        return false;
      }
    });
      });

  function checkNumber() {
    layui.use(['layer'], function () {
      var $ = layui.jquery;
      var layer = layui.layer;
      var val = $("#deliveryQuantity").val().replace(/\s+/g, "");
      var regPos = /^\d+(\.\d+)?$/; //非负浮点数
      var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
      if (regPos.test(val) || regNeg.test(val)) {
        $("#deliveryQuantity").val(val);
        return true;
      }
      $("#deliveryQuantity").val("");
      layer.msg('交付数量只能输入数字！', {icon: 5});
    })

  }
</script>
</body>
</html>